<template>
  <div class="userProblem" v-if="problemDetail">
    <div class="lab">{{ problemDetail.tableName }}</div>
    <div class="bottomPart pa-flex">
      <div class="pa-flex" v-if="true">
        <div class="common type" v-show="problemDetail.tableName == '外线联报'">
          <div class="title" >联报类型</div>
          <div class="text pa-fs-ellipsis">{{ gtype }}</div>
        </div>
        <div class="common content" v-show="problemDetail.tableName == '外线联报'">
          <div class="title">联报内容</div>
          <div class="text">{{ problemDetail.guaranty }}</div>
        </div>
      </div>
      <div class="pa-flex" v-if="false">
        <div class="common type">
          <div class="title">帮办标题</div>
          <div class="text">通网络、通电</div>
        </div>
        <div class="common content">
          <div class="title">帮办类型</div>
          <div class="text">模拟审批</div>
        </div>
      </div>
      <div class="common desc">
        <div class="title">需求描述</div>
        <div class="text pa-fs-ellipsis">{{ problemDetail.content }}</div>
      </div>
      <div class="common date">
        <div class="title">提交时间</div>
        <div class="text">{{ problemDetail.createTime && problemDetail.createTime.split(' ')[0] }}</div>
      </div>
      <el-button class="button" @click="accept(1)" v-if="problemDetail.status == 2">去受理</el-button>
      <el-button class="button" @click="accept(2)" v-if="problemDetail.status == 1">查看详情</el-button>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    problemDetail: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  computed: {
    gtype() {
      if (this.problemDetail.gtype == 1) {
        return '通水'
      } else if (this.problemDetail.gtype == 2) {
        return '通电'
      } else if (this.problemDetail.gtype == 3) {
        return '通气'
      } else if (this.problemDetail.gtype == 4) {
        return '通网络'
      }
    }
  },
  methods: {
    accept(flag) {
      this.$router.push({
        path: '/my/manage/problemDetail',
        query: {
          id: this.problemDetail.id,
          type: this.problemDetail.types,
          flag
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.userProblem {
  // width: 855px;
  height: 118px;
  background: #ffffff;
  box-shadow: 0px 6px 58px 0px rgba(196, 203, 214, 0.1);
  border-radius: 24px;
  padding: 13px 0 0 28px;
  position: relative;
  .lab {
    width: 80px;
    height: 27px;
    text-align: center;
    line-height: 27px;
    background: #d8e8ff;
    border: 1px solid #2f86fd;
    border-radius: 12px;
    color: #2f86fd;
    margin-bottom: 10px;
  }
  .bottomPart {
    .title {
      font-size: 14px;
      color: #91929e;
      margin-bottom: 10px;
    }
    .text {
      color: #0a1629;
    }
    .common {
      width: 100px;
      margin-right: 23px;
    }
    .type {
      width: 100px;
    }
    .button {
      width: 110px;
      height: 35px;
      background: #408cff;
      border-radius: 10px;
      padding: 0;
      position: absolute;
      right: 55px;
      top: 35px;
      color: #fff;
    }
  }
}
</style>
